package priv.stones.collections.list;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @Author: Stones
 * @Description:
 * @Date: 2017/11/4 22:21
 */
public class ArrayList1 {

    public static void main(String[] args) {
        List<String> data = new ArrayList<String>();
        System.out.println(data.isEmpty());
        data.add("test1");
        data.add("test2");
        data.add("test3");
        data.add("test4");
        data.add("test1");
        data.add(0,"test0");
        System.out.println(data.isEmpty());



        System.out.println(data);


        Iterator<String> iterator = data.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }


        System.out.println("foreach");


        for (String d : data) {

            System.out.println(d);
        }



    }

}
